<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta content="IE=EmulateIE7" http-equiv="X-UA-Compatible">
<title>用户登录--<!--{$mallname}--></title>
<!--{include(file='static.html')}-->
</head>
<body>
<!--{include(file='head.html')}-->
    <!--主体内容-->
	<div class="container" style="padding:50px 0 30px;">
	<div class="log_box">
        <!--登录-->
		<div class="log_left">
			<p class="loginret"></p>
			<div class="login_name">
				<input name="uname" id="uname" type="text"  value="用户名" />
			</div>
			<p class="loginhint"></p>
			<div class="clear"></div>
			<div class="login_pass">
				<input name="pass2" id="pass2" type="text"	   value="密码"/>
				<input name="pass"  id="pass"  type="password" value="" class="none"/>
			</div>
			<p class="loginhint"></p>
			<div class="clear"></div>
            <div class="login_but">
				<input type="submit" class="o_button" value="登 录" id="login_btn" onclick="checklogin()"/>
				<a href="<!--{url('index','user','forgetpwd')}-->">忘记密码？</a>
			</div>
           <!--{if $tlogins}-->
           <div class="login_qt">
				<p>或通过合作网站直接登录</p>
				<ul class="ext_connect">
					<!--{foreach $tlogins tlogin}-->
						<li class="<!--{$tlogin.host}-->">
							<a href="connect.php?w=<!--{$tlogin.host}-->"	target="_blank"><!--{$tlogin.name}--></a>
						</li>
					<!--{/foreach}-->
				</ul>
				<div class="clear"></div>
			</div>
			<!--{/if}-->
			<script type="text/javascript">
				$(function(){
					$("#uname").focus(function(){
						var $this = $(this),val = $this.val(),$parent = $this.parent();
						$parent.removeClass("hintborder");
						$parent.next().text('');
						$(".loginret").text('');
						if(val == "用户名") {
							$this.val('');
						}
					}).blur(function(){
						var $this = $(this),val = $this.val();
						if(val == "") {
							$this.val("用户名");
						}
					}).keydown(function(event){
						if(event.keyCode == 13) {
							checklogin();
						}
					});
					$("#pass2").focus(function(){
						var $this = $(this),$parent = $this.parent();
						$this.hide();
						$parent.removeClass("hintborder");
						$parent.next().text('');
						$(".loginret").text('');
						$("#pass").show().focus();
					});
					$("#pass").blur(function(){
						var $this = $(this),val = $this.val();
						if(val == "") {
							$this.hide();
							$("#pass2").show();
						}
					}).keydown(function(event){
						if(event.keyCode == 13) {
							checklogin();
						}
					});
				});
				function checklogin(){
					var $uname = $("#uname"),uname = $uname.val(),
						$pass  = $("#pass"),pass = $pass.val();
						ret = true;
					if(uname == "" || uname == "用户名") {
						$uname.parent().next().text("请填写此项").show();
						$(".login_name").addClass("hintborder");
						ret = false;
					}
					if(pass == "") {
						$pass.parent().next().text("请填写此项").show();
						$(".login_pass").addClass("hintborder");
						ret = false;
					}
					if(!ret) return false;
					$("#login_btn").val("正在验证");
					$.post("<!--{url('index','user','dologin','',false)}-->",{uname:uname,pass:pass},function(data){
						$("#login_btn").val("登 录");
						if(data.ret == "success") {
							window.location.href = data.msg;
						} else {
							$(".loginret").text(data.msg).show();
						}
					},"json");
				};
			</script>
        </div>
		 <div class="log_right">
        	<p class="text_14">注册成为会员</p>
            <p style="padding-top:15px;">免费注册成为会员，享受会员特权</p>
            <p>查看跟踪管理自己的购物信息，让您随时了解订单状态。</p>
            <p class="log_link"><a href="<!--{url('index','user','reg')}-->">点击注册会员</a></p>
        </div>
        <div class="clear"></div>
        <!--登录 end-->
    </div>
</div>
<!--{include(file='foot.html')}-->
</body>
</html>